package com.liuxing.observer.demo;

/**
 * @ClassName ObserverTest
 * @Description
 * @Author ymy
 * @Date 2021/5/21 14:58
 */
public class ObserverTest {

    public static void main(String[] args) {
        MySubject mySubject = new MyConcreteSubject();
        mySubject.reg(new MyObserverA());
        mySubject.reg(new MyObserverB());
        mySubject.reg(new MyObserverC());
        Msg msg = new Msg();
        msg.setId(1);
        msg.setName("小明");
        mySubject.notify(msg);
    }
}
